package com.contactbook.web.client.gwt;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Widget;

public class ListItem extends ComplexPanel implements HasText {
    public ListItem() {
            setElement(DOM.createElement("LI"));
    }

    public void add(Widget widget) {
            super.add(widget, getElement());
    }

    public void insert(Widget widget, int beforeIndex) {
            super.insert(widget, getElement(), beforeIndex, true);
    }

    public String getText() {
            return DOM.getInnerText(getElement());
    }

    public void setText(String text) {
            DOM.setInnerText(getElement(), (text == null) ? "" : text);
    }

} 
